<?php //echo Yii::app()->request->baseUrl; ?>
<link rel="stylesheet"
	href="<?php echo Yii::app()->request->baseUrl; ?>/assets/css/bootstrap.css"
	type="text/css" media="screen" />
<link rel="stylesheet"
	href="<?php echo Yii::app()->request->baseUrl; ?>/assets/css/bootstrap-responsive.css"
	type="text/css" media="screen" />
<div class="container">
	<div class="jumbotron">
<?php    
$rout_api = Yii::app()->request->baseUrl."routeros_api.class.php";
		require('routeros_api.class.php');
	
		$API = new routeros_api();
	
		if ($API->connect('192.168.88.1', 'admin', '')) {
	
			$API->write('/ip/hotspot/user/getall');

	
			$READ = $API->read(false);
			$ARRAY = $API->parse_response($READ);
	
			//echo "<pre>";print_r($ARRAY);echo "</pre>";
	
			$API->disconnect();
	
		}
?>

<table class="table table-hover">
	<tbody>
<?php
$i = 0;
foreach ( $ARRAY as $data ) {
	
	$name=$data['name'];
	$profile=$data['profile'];
	$uptime=$data['uptime'];
	// echo "$key is at $value";
	if($i==0){
	?>
		<tr>
			<td colspan="<?php echo (count($data)+1); ?>">
				<button type="button" class="btn btn-default"
					onClick="">Remove</button>
				<button type="button" class="btn btn-default"
					onClick="">Disable</button>
			</td>
		</tr>
		<tr>
			<th></th>
			<?php 
			foreach ($data as $key=>$value){
			    echo '<th>'.$key.'</th>';
			}
			?>
		</tr>
	<?php 
	}
	?>
 		<tr>
			<td>
				<div class="checkbox">
					<label> <input type="checkbox">
					</label>
				</div>
			</td>
			<?php 
			foreach ($data as $key=>$value){
				if($key=='password') $value='***';
			    echo '<td>'.$value.'</td>';
			}
			?>
		</tr> 
		 
		<tr>
			<td colspan="<?php echo (count($data)+1); ?>">
				<button type="button" class="btn btn-default"
					onClick="">Remove</button>
				<button type="button" class="btn btn-default"
					onClick="">Disable</button>
			</td>
		</tr>
<?php 
$i++; 
}
?> 
   
     </tbody>
</table>

	</div>
</div>

